package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarmerasAbilityMapper;
import com.ruoyi.system.domain.CarmerasAbility;
import com.ruoyi.system.service.ICarmerasAbilityService;

/**
 * 摄像头能力Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-15
 */
@Service
public class CarmerasAbilityServiceImpl implements ICarmerasAbilityService 
{
    @Autowired
    private CarmerasAbilityMapper carmerasAbilityMapper;

    /**
     * 查询摄像头能力
     * 
     * @param id 摄像头能力ID
     * @return 摄像头能力
     */
    @Override
    public CarmerasAbility selectCarmerasAbilityById(Long id)
    {
        return carmerasAbilityMapper.selectCarmerasAbilityById(id);
    }

    /**
     * 查询摄像头能力列表
     * 
     * @param carmerasAbility 摄像头能力
     * @return 摄像头能力
     */
    @Override
    public List<CarmerasAbility> selectCarmerasAbilityList(CarmerasAbility carmerasAbility)
    {
        return carmerasAbilityMapper.selectCarmerasAbilityList(carmerasAbility);
    }

    /**
     * 新增摄像头能力
     * 
     * @param carmerasAbility 摄像头能力
     * @return 结果
     */
    @Override
    public int insertCarmerasAbility(CarmerasAbility carmerasAbility)
    {
        carmerasAbility.setCreateTime(DateUtils.getNowDate());
        return carmerasAbilityMapper.insertCarmerasAbility(carmerasAbility);
    }

    /**
     * 修改摄像头能力
     * 
     * @param carmerasAbility 摄像头能力
     * @return 结果
     */
    @Override
    public int updateCarmerasAbility(CarmerasAbility carmerasAbility)
    {
        carmerasAbility.setUpdateTime(DateUtils.getNowDate());
        return carmerasAbilityMapper.updateCarmerasAbility(carmerasAbility);
    }

    /**
     * 批量删除摄像头能力
     * 
     * @param ids 需要删除的摄像头能力ID
     * @return 结果
     */
    @Override
    public int deleteCarmerasAbilityByIds(Long[] ids)
    {
        return carmerasAbilityMapper.deleteCarmerasAbilityByIds(ids);
    }

    /**
     * 删除摄像头能力信息
     * 
     * @param id 摄像头能力ID
     * @return 结果
     */
    @Override
    public int deleteCarmerasAbilityById(Long id)
    {
        return carmerasAbilityMapper.deleteCarmerasAbilityById(id);
    }

    @Override
    public List<CarmerasAbility> listAbilityByCarmId(CarmerasAbility carmerasAbility) {
        return carmerasAbilityMapper.listAbilityByCarmId(carmerasAbility);
    }
}
